#查找数据

#顺序查找

#1
'''
aList=[1,3,45,67,778,789,'',766]
x = int(input("请输入要查找的整数：")
for i in aList:
 if i == x:
   print("找到了，整数%d在列表中"%x)
   
'''

#2
'''
aList = [1,3,45,67,778,789,'',766]
x = int(input("请输入要查找的整数：")
for i in range(len(aList)):
  if aList[i] == x:
    print("找到了，第%d个数，是%d"%(i+1,x))
    
'''

#3
'''
aList = [1,3,45,67,778,789,'',766]
sign = False
x = int(input("请输入要查找的整数："))
for i in range(len(aList)):
        if aList[i] ==x:
          print("找到了，第%d个数是%d。"%(i+1,x))
          sign = True
if sign == False:
  print("没有找到")

 '''

#顺序查找
#16 in aList ---> true or false

#index()  ---> aList.index(5) ---> 第一个5的下标
#aList.index(5,4,10)  从小标4开始到下标10-1的第一个数据为5的下标

#count()
#aList.count(5) 有多少个5？


aList = [1,3,45,67,2,34,789,2,'',766]
x = int(input("请输入要查找的整数："))
n = aList.count(x)
if n == 0:
  print("没找到")
else:
  j = 0
  for i in range(n):
    j = aList.index(x,j,len(aList)) + 1
    print("找到了")
    

